<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正则表达式操作dom元素</title>
</head>
<body>
    <p>houdunren</p>
    <H1>后盾人</H1>
    <h2></h2>
    <h3>hgsjkfghlkdhgfdjlg</h3>
    <script>
        let body = document.body;
        let reg = /<(h[1-6])>[\s\S]*<\/\1>/gi;
        body.innerHTML = body.innerHTML.replace(reg,'');
    </script>
</body>
</html>